package com.nervenets.web.hibernate.domain;

import com.nervenets.web.enumeration.PropertyName;
import com.nervenets.web.hibernate.DomainObject;
import org.hibernate.annotations.Index;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Joe Ding at 2011-2-11 23:59:17
 */
@Entity
@Table(name = "properties")
public class Property extends DomainObject {
    @Column(name = "name", columnDefinition = "tinyint")
    @Index(name = "_idx_properties_name")
    private PropertyName name;
    @Column(name = "val", columnDefinition = "longblob")
    private String value;

    public Property() {
    }

    public Property(PropertyName name) {
        this.name = name;
    }

    public PropertyName getName() {
        return name;
    }

    public void setName(PropertyName propertyName) {
        this.name = propertyName;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return value;
    }
}
